package com.cx.service.impl;

import com.cx.mapper.AddressMapper;
import com.cx.mapper.GoodDetailMapper;
import com.cx.mapper.OrderGoodsMapper;
import com.cx.mapper.OrdersMapper;
import com.cx.pojo.Address;
import com.cx.pojo.GoodDetail;
import com.cx.pojo.OrderGoods;
import com.cx.pojo.Orders;
import com.cx.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：zhangjie
 * @Description :
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private AddressMapper addressMapper;

    @Autowired
    private OrdersMapper ordersMapper;

    @Autowired
    private OrderGoodsMapper orderGoodsMapper;

    @Autowired
    GoodDetailMapper goodDetailMapper;
    @Override
    public List<Address> selectByUserId(Integer id) {
        return addressMapper.selectByUserId(id);
    }

    @Override
    public int insert(Address address) {
        return addressMapper.insert(address);
    }

    @Override
    public GoodDetail selectById(Integer id) {
        return goodDetailMapper.selectById(id);
    }

    @Override
    public int insert(Orders record) {
        return ordersMapper.insert(record);
    }

    @Override
    public int insert(OrderGoods record) {
        return orderGoodsMapper.insert(record);
    }

    @Override
    public List<Orders> selectALL() {
        return ordersMapper.selectALL();
    }

    @Override
    public Address selectByPrimaryKey(Integer id) {
        return addressMapper.selectByPrimaryKey(id);
    }

    @Override
    public Orders selectByKey(Integer id) {
        return ordersMapper.selectByKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Orders record) {
        return ordersMapper.updateByPrimaryKeySelective(record);
    }
}
